﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.XtraBars.Docking;

namespace td.Core
{
    public class MyDockPanel : DockPanel, IPad
    {
        public MyDockPanel()
            : base()
        {

        }  
        protected internal MyDockPanel(bool createControlContainer, DockingStyle dock, MyDockManager manager)
            : base(createControlContainer, dock, manager)
        {
            
            if ((manager != null))
            {
                this.Text = string.Format("MyDockPanel{0}", manager.Panels.Count + 1);
            }
        }
        public string caption
        {
            get
            {
                return this.Text;
            }
            set
            {
                this.Text = value;
            }
        }

        public event EventHandler TitleChanged;

        public bool ShowAutoHideButton
        {
            get
            {
                return this.Options.ShowAutoHideButton;
            }
            set
            {
                this.Options.ShowAutoHideButton = value;
            }
        }

        public bool ShowCloseButton
        {
            get
            {
                return this.Options.ShowCloseButton;
            }
            set
            {
                this.Options.ShowCloseButton = value;
            }
        }

        public DockingStyle dockStyle
        {
            get
            {
                return this.Dock;
            }
            set
            {
                this.Dock = value;
            }
        }

        public string Title
        {
            get
            {
                return this.Text;
            }
            set
            {
                this.Text = value;
            }
        }

        private DevExpress.XtraEditors.XtraUserControl viewContentControl = null;
        public DevExpress.XtraEditors.XtraUserControl ViewContentControl
        {
            get { return   this.viewContentControl; }
            set
            {
                if (this.viewContentControl != null)
                {
                    this.viewContentControl = value;

                }
                else
                {

                    this.viewContentControl = value;
                    this.Controls.Add(this.viewContentControl);
                }
            }
        }








        public virtual System.Drawing.Image Icon
        {
            get;
            set;
        }
    }
}
